package com.isoft.service.impl;

import com.isoft.service.dashboardService;
import com.isoft.mapper.DashboardMapper;
import com.isoft.pojo.vo.overviewVO;
import com.isoft.pojo.vo.statisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class dashboardServiceImpl implements dashboardService {
    @Autowired
    private DashboardMapper dashboardMapper;


    /**
     * 获取仪表盘顶部数据
     *
     * @return
     */
    @Override
    public overviewVO getOverview() {
        overviewVO overviewVO = new overviewVO();
        overviewVO.setSystemCount(dashboardMapper.getSystemCount());
        overviewVO.setTableCount(dashboardMapper.getTableCount());
        overviewVO.setFieldCount(dashboardMapper.getFieldCount());
        return overviewVO;
    }

    /**
     * 获取仪表盘中间数据
     *
     * @return
     */
    @Override
    public List<statisticsVO> getStatistics() {
        return dashboardMapper.getStatistics();
    }


    /**
     * 获取安全级别数据
     * @return
     */
    @Override
    public List<statisticsVO> getSecurityStatistics() {
        return dashboardMapper.getSecurityStatistics();
    }
}
